package main

import "fmt"

func main() {
	var arr [4]int
	arr[0] = 1
	arr[1] = 2
	arr[2] = 3
	arr[3] = 4
	fmt.Println(arr)
	fmt.Println(arr[0])
	fmt.Printf("%p\n", &arr)

	fmt.Println(len(arr))
	fmt.Println(cap(arr))

	var d = [5]int{1: 1, 3: 2}
	fmt.Println(d)

	f := [...]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 0}
	//fmt.Println(f[0])
	for i := 0; i < len(f); i++ {
		fmt.Println(f[i])
	}
	fmt.Println(f)

	g := [...]int{1, 2, 3, 4, 5}
	fmt.Println(len(g))

	w := [...]int{}
	fmt.Println(w)

	//二维数据
	arr2 := [3][4]int{{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}}
	fmt.Println(arr2)

	//遍历
	for _, value := range arr2 {
		for _, value_ := range value {
			fmt.Println(value_)
		}
	}
}
